﻿#region Includes
using System;
using System.Runtime.InteropServices;
#endregion

namespace GingerGL.Graphics.Models.BSP
{
    //------------------------------------------------------------//
    /// <summary>
    /// vertex as found in file
    /// </summary>
    [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
    public struct BSPVertex
    {
        //--------------------------------------------------------//
        #region Variables
        [MarshalAs(UnmanagedType.ByValArray, ArraySubType = UnmanagedType.R4, SizeConst = 3)]
        public float[] Position;
        [MarshalAs(UnmanagedType.R4)]
        public float DecalS, DecalT;
        [MarshalAs(UnmanagedType.R4)]
        public float LightMapS, LightMapT;
        [MarshalAs(UnmanagedType.ByValArray, ArraySubType = UnmanagedType.R4, SizeConst = 3)]
        public float[] Normal;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
        public byte[] Color;

        static public readonly int SizeInBytes = sizeof(byte) * 4 + sizeof(float) * 10;
        #endregion
        //--------------------------------------------------------//
    }
    //------------------------------------------------------------//
}
